package cn.ywsj.ywsjmidtier.controller;

import cn.ywsj.ywsjmidtier.entity.VO.LeavewordsVo;
import cn.ywsj.ywsjmidtier.service.WechatCenterFeign;
import cn.ywsj.ywsjmidtier.utils.JsonObjectUtil;
import com.alibaba.fastjson.JSONObject;
import org.apache.xmlbeans.impl.jam.JSourcePosition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName : WechatCenterController
 * @Author : Lenovo
 * @Date: 2021/7/23 14:35
 * @Description :
 */
@RestController
@RequestMapping("/wechat/member/center")
public class WechatCenterController {
    @Autowired
    private WechatCenterFeign wechatCenterFeign;
    @RequestMapping("/ajaxindex")
    public String ajaxIndex(String loginType, HttpServletRequest request){
        return wechatCenterFeign.ajaxIndex(loginType,request);
    }
    @PostMapping("/getpersonalinformation")
    public String ajaxPersonalInformation(){
        return wechatCenterFeign.ajaxPersonalInformation();
    }
    @RequestMapping("/ajaxaccountinfo")
    public String ajaxAccountInfo() {
        return wechatCenterFeign.ajaxAccountInfo();
    }
    @RequestMapping("/addleavewords")
    public String addLeavewords(LeavewordsVo leavewordsVo){
        JSONObject jsonObject = JsonObjectUtil.ObjectToJson(leavewordsVo);
        return wechatCenterFeign.addLeavewords(jsonObject);
    }
}
